//
//  FamilyRecordSectionHeaderView.m
//  安好
//
//  Created by lianchuang on 14-12-16.
//  Copyright (c) 2014年 lianchuangbrother. All rights reserved.
//

#import "FamilyRecordSectionHeaderView.h"

#define IPhone6Plus ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(1242, 2208), [[UIScreen mainScreen] currentMode].size) : NO)


@implementation FamilyRecordSectionHeaderView
- (id)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        // Initialization code
        [self makeUi];
        
    }
    return self;
}
-(void)makeUi
{
    CGFloat flagWeight = 15;
    if (IPhone6Plus) {
        flagWeight = 20;
    }
    
    self.backgroundColor = [UIColor whiteColor];
    //标题“初诊”、复诊
    self.FamilyHeaderTitleLable = [[UILabel alloc] initWithFrame:CGRectMake(flagWeight, 12, 80, 20)];
    self.FamilyHeaderTitleLable.top = (self.height - self.FamilyHeaderTitleLable.height)/2.0;
    
    self.FamilyHeaderTitleLable.textColor = [UIColor colorWithRed:31/255.0 green:33/255.0 blue:36/255.0 alpha:1];
    self.FamilyHeaderTitleLable.font = [UIFont systemFontOfSize:14];
    if (IPhone6Plus) {
        self.FamilyHeaderTitleLable.font = [UIFont systemFontOfSize:16];
    }
    self.FamilyHeaderTitleLable.textAlignment = NSTextAlignmentLeft;
    [self addSubview:self.FamilyHeaderTitleLable];
    //时间底部View
    self.FamilyTimeBackView = [[UIView alloc] initWithFrame:CGRectMake(120, 12, 200, 20)];
    self.FamilyTimeBackView.right = kScreenWidth - flagWeight;
    self.FamilyTimeBackView.top = (self.height -self.FamilyTimeBackView.height)/2.0;
    [self addSubview:self.FamilyTimeBackView];
    
        //
    self.FamilyTimeLable = [[UILabel alloc] initWithFrame:CGRectMake(26, 0, 115, 20)];
    
    self.FamilyTimeLable.textColor = [UIColor colorWithRed:169/255.0 green:169/255.0  blue:169/255.0  alpha:1];
    self.FamilyTimeLable.textAlignment = NSTextAlignmentRight;
    self.FamilyTimeLable.font = [UIFont systemFontOfSize:13];
    if (IPhone6Plus) {
        self.FamilyTimeLable.font = [UIFont systemFontOfSize:15];
        self.FamilyTimeLable.width = 130;
        
    }
    self.FamilyTimeLable.left = self.FamilyTimeBackView.width - self.FamilyTimeLable.width;
    [self.FamilyTimeBackView addSubview:self.FamilyTimeLable];
    
    self.FamilyTimeImg = [[UIImageView alloc] initWithFrame:CGRectMake(15, 4, 12, 12)];
    [self.FamilyTimeImg setImage:[UIImage imageNamed:@"挂号_时间.png"]];
    if (IPhone6Plus) {
        self.FamilyTimeImg.width = 14;
        self.FamilyTimeImg.height = 14;
    }
    self.FamilyTimeImg.top = (self.FamilyTimeBackView.height - self.FamilyTimeImg.height)/2.0;
    self.FamilyTimeImg.right = self.FamilyTimeLable.left;
    [self.FamilyTimeBackView addSubview:self.FamilyTimeImg];
    

    
    //
    self.topLineImg = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 0.3)];
    [self addSubview:self.topLineImg];
    //
    self.bottomLineImg =[[UIImageView alloc] initWithFrame:CGRectMake(0, self.height-0.5, kScreenWidth, 0.5)];
    [self addSubview:self.bottomLineImg];
    //
    self.FamilyHeaderButton = [UIButton buttonWithType:UIButtonTypeRoundedRect];
    self.FamilyHeaderButton.frame = self.bounds;
    [self addSubview:self.FamilyHeaderButton];

}

@end
